package com.atguigu.sugar.mapper;

import com.atguigu.sugar.bean.ProvinceBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author lzc
 * @Date 2022/6/2 11:16
 */
public interface ProvinceMapper {
    
    @Select("SELECT\n" +
        "    province_name,\n" +
        "    sum(order_amount) AS order_amount,\n" +
        "    sum(order_count) AS order_count\n" +
        "FROM dws_trade_province_order_window\n" +
        "WHERE toYYYYMMDD(stt) = #{date}\n" +
        "GROUP BY province_name")
    List<ProvinceBean> statsProvince(@Param("date") Integer date);
}
